/*
 * 创建日期 2005-12-12
 *
 * 更改所生成文件模板为
 * 窗口 > 首选项 > Java > 代码生成 > 代码和注释
 */
package com.vanda.report.cfg;

import java.util.HashMap;

import com.vanda.report.element.ReportElement;

/**
 * @author wkf5985
 *
 * 更改所生成类型注释的模板为
 * 窗口 > 首选项 > Java > 代码生成 > 代码和注释
 */
public class ReportCfgBean {
	private static ReportCfgBean _cfgBean ;
	private static HashMap _propertys = new HashMap();
	private static HashMap _reports = new HashMap();
	private static HashMap _validator = new HashMap();
	
	static ReportCfgBean getInstance(){
		if(_cfgBean != null){
			return _cfgBean;
		}
		return new ReportCfgBean();
	}
	
	void setPropertys(HashMap propertys){
		_propertys.clear();
		_propertys.putAll(_propertys);
	}
	
	void setReports(HashMap reports){
		_reports.clear();
		_reports.putAll(reports);
	}
	
	void setValidator(HashMap validator){
		_validator.clear();
		_validator.putAll(validator);
	}
	
	public static String getProperty(String key){
		return (String)_propertys.get(key);
	}
	
	public static ReportElement getReport(String key){
		return (ReportElement)_reports.get(key);
	}
	
	public static ValidatorBean getValidatorBean(String key){
		return (ValidatorBean)_validator.get(key);
	}
}
